package com.bawei.module_mine.model

import com.bawei.lib_common.formatCount


/**
 *作者：lxy
 *功能:
 *时间：2025/5/27
 */
data class MineModel(
    val avatar: Image? = null,
    val cellphone: String = "",
    val commentNumber: Int = 0,
    val gender: Int = 0,
    val giveLikeNumber: Int = 0,
    val hobby: String? = "",
    val medalImg: List<String>? = null,
    val messageNumber: Int = 0,
    val nickName: String = "",
    val releaseNumber: Int = 0,
    val memberId: String = "",
    val userName: String = "",
    val ifPassword: Int? = 0,
    val realName: String? = null,
    val likeNumber: Int = 0,
    // 2024年01月16日14:30:26 新增
    val fansNumber: Int = 0,   //粉丝数量
    var focusNumber: Int = 0,   //关注数量
    val friendNumber: Int = 0,   //好友数量
    val collectNumber: Int = 0,// 收藏数量
    val mallHistoryNumber: Int = 0,// 足迹数量
    // 2024年01月18日15:21:47 新增-人物关系
    var relation: Int = 0
){
    /**
     * 是否是我自己，是我自己的话，用户中心页需要隐藏聊天和关注两个按钮
     */
    fun ifMySelf() = relation == 0

    fun requireMessageNumStr(): String {
        if (messageNumber == 0)
            return ""
        if (messageNumber <= 99)
            return messageNumber.toString()

        return "99+"
    }

    fun requireLikeNumStr(): String {
        if (likeNumber == 0)
            return ""
        if (likeNumber <= 99)
            return likeNumber.toString()

        return "99+"
    }

    fun requireHobby(): String {
        if (hobby.isNullOrBlank()) {
            return "未添加签名"
        }
        return hobby
    }

    fun requireMedalNum(): String {
        if (medalImg.isNullOrEmpty())
            return "0"
        return medalImg.size.toString()
    }

    fun requireCollectionNum(): String {
        return collectNumber.formatCount()
    }

    fun requireHistoryNum(): String {
        return mallHistoryNumber.formatCount()
    }

    fun formatFriendCount(): String {
        return "朋友 $friendNumber "
    }

    fun formatFansCount(): String {
        return "粉丝 $fansNumber "
    }

    fun formatFocusCount(): String {
        return "关注 $focusNumber "
    }
}

data class Image(
    val contentLength: Int = 0,
    val contentType: String = "",
    val filename: String = "",
    val firstImage: String = "",
    val imageHeight: Int = 0,
    val imageWidth: Int = 0,
    val thumbnailUrl: String? = "",
    val url: String
)


data class Topic(
    val topicId: String,
    val topicName: String
)